package com.community.charge.mapper;

import java.util.List;
import com.community.charge.domain.ChargeItem;
import com.community.charge.domain.vo.ChargeItemVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * itemaMapper接口
 * 
 * @author mdh
 * @date 2025-10-27
 */
public interface ChargeItemMapper 
{
    /**
     * 查询itema
     * 
     * @param chargeItemId itema主键
     * @return itema
     */
    public ChargeItem selectChargeItemByChargeItemId(Long chargeItemId);

    /**
     * 查询itema列表
     * 
     * @param chargeItem itema
     * @return itema集合
     */
    public List<ChargeItem> selectChargeItemList(ChargeItem chargeItem);

    /**
     * 新增itema
     * 
     * @param chargeItem itema
     * @return 结果
     */
    public int insertChargeItem(ChargeItem chargeItem);

    /**
     * 修改itema
     * 
     * @param chargeItem itema
     * @return 结果
     */
    public int updateChargeItem(ChargeItem chargeItem);

    /**
     * 删除itema
     * 
     * @param chargeItemId itema主键
     * @return 结果
     */
    public int deleteChargeItemByChargeItemId(Long chargeItemId);

    /**
     * 批量删除itema
     * 
     * @param chargeItemIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteChargeItemByChargeItemIds(Long[] chargeItemIds);

    //点击禁用按钮禁用
    @Update("update charge_item set status = 1 where charge_item_id =#{id}")
    Integer disable(Integer id);

    //点击启用按钮启用
    @Update("update charge_item set status = 0 where charge_item_id =#{id}")
    Integer enable(Integer id);

    //绑定收费项目下拉框
    @Select("select charge_item_id as chargeItemId, name, price from charge_item where status=0")
    List<ChargeItemVo> getChargeItem();

}
